﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CaptchaMvc;
using CaptchaMvc.Attributes;
using CaptchaMvc.HtmlHelpers;
using CaptchaMvc.Models;
using BabyToys.Models.ViewModel;
namespace BabyToys.Controllers
{
    public class TaiKhoanController : Controller
    {
        //
        // GET: /TaiKhoan/

        public ActionResult Index()
        {
            return View();
        }
        public ActionResult DangNhap()
        {
            return View();
        }
        public ActionResult DangKy()
        {
            return View();
        }
        [HttpPost]
        public ActionResult DangKy(KhachHangViewModel khachhang)
        {
            if (ModelState.IsValid)
            {
                if (this.IsCaptchaValid("Captcha is not valid"))
                {
                    khachhang.IdLoaiKhachHang = 1;
                    khachhang.IsActive = true;
                    khachhang.IsOnline = true;
                    BabyToys.DAL.RegisterDAL reg = new DAL.RegisterDAL();
                    reg.ThemKhachHang(khachhang);
                }
                else
                {
                }
            }
            return View(khachhang);
        }
        public ActionResult DoiMatKhau()
        {
            return View();
        }


    }
}
